
<%--
 *  File:    OrgPopWindow4checkbox1.jsp
 *  @Author: visazhou
 *  Date:    2009/12/15
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval"%>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom"%>

<%//init param
	String privilegeCode = "ALL";
	String strModuleName = "COM";
	String strTableName = "ovcity";
	String contextPath = request.getContextPath();


%>

<%//--------------------------------------  include files list --%>

<%@ include file="/inc/PageDefault.inc"%>
<%@ include file="/inc/LocationDefault.inc"%>


<html>
<head>
<title>OrgPopWindow</title>
<PageFlow:CheckPageFlow pageName="p_agreementcitycheckbox1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc"%>

<%//--------------------------------------  output variant from pageflow --%>
<%
	Vector orgSummary = (Vector)pageContext.getAttribute("orgsummary");
	if(orgSummary == null) orgSummary = new Vector();

	/*Integer globalpccode = (Integer)pageContext.getAttribute("globalpccode");
	if(globalpccode == null) globalpccode = new Integer("");*/

%>
<script>

function clickOrg(id,name,code){
	document.frm.cityid.value = id;
	document.frm.cityname.value = name;
	document.frm.citycode.value = code;
}

function page_summary(actionvalue,orderbyname){
	var editform = summaryPrepare(frm,actionvalue,orderbyname);
		editform.action = "AgreementCityPopcheckbox1.jsp?<%= OvalTools.randomURL() %>"+"&languagecode=<%=strLanguageCode%>";
	editform.target = "_self";
	isRunning = true;
	editform.submit();
}


function allcheckselect(){
	var allcheck = frm.allcheck.checked;
	var orgids = document.getElementsByName('orgids');
	var length = orgids.length;
	if(allcheck){
		for(var i = 0 ; i < length;i++){
			orgids[i].checked = true;
		}
	}else{
		for(var i = 0 ; i < length;i++){
			orgids[i].checked = false;
		}
	}
}

function add(){
if(nullChecked(document.frm.orgids))
    {
        alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD") %>");
        return;
    }
	 frm.actionname.value = "add";
  	 frm.target = "_parent";
  	 isRunning = true;
  	 frm.submit();
}
</script>
</head>

<body>

<%//--------------------------------------  hidden form variant --
	String gcode = request.getParameter("globalpccode");
%>
<form name="frm" method="post" action="../../Dispatcher" target="_parent">
	<input type="hidden" name="pagename" value="p_agreementcitycheckbox1">
	<input type="hidden" name="actionname">
	<!--<input type="hidden" name="globalpccode" value="">-->

    <custom:hidden property="globalpccode"></custom:hidden>
    <custom:hidden property="category"></custom:hidden>
     <custom:hidden property="regionidstr"></custom:hidden>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
	<tr>
		<table width="100%" border="0" cellspacing="0">
			<tr>

				<td>
				<table>
					<%@ include file="/inc/SummarySearch.inc"%>
				</table>
				</td>
			</tr>
		</table>
	</tr>
	<tr>
		<td>
		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0">
		<tr class="deepblue-left">
          <td width="5%" class="deepblue-left">&nbsp;<input type="checkbox" name="allcheck" class="normalradio" onclick="allcheckselect();"></td>
          <td width="15%" class="title_center">&nbsp;<a href="javascript:page_summary('orderby','citycode')"><%= label.getLabelName("L_City") %><%= label.getLabelName("L_Code") %></a></td>
          <td width="40%" class="title_center">&nbsp;<a href="javascript:page_summary('orderby','cityname')"><%= label.getLabelName("L_City") %><%= label.getLabelName("L_Name") %></a></td>
        </tr>

        <%
	        int i = 0;
	        String strClassType = new String();
	        String strIsChecked = "Checked";
	        String strOrgCode = "";
	        String strOrgName = "";
	        Integer nOrgid = new Integer("-1");
        %>
        <logic:iterate id="orgs" collection="<%= orgSummary %>">
        <%
	        HashMap orgMap = (HashMap)pageContext.getAttribute("orgs");
	        if(i%2 == 1)
	          	strClassType = "td-listrom";
	        else
	          	strClassType = "none";

	        if(i != 0){
	          	strIsChecked = "";
	        }else{
	        	strOrgCode = (String)(orgMap.get("citycode"));
	        	strOrgName = (String)(orgMap.get("cityname"));
	        	nOrgid = (Integer)(orgMap.get("cityid"));
	        }
	        i++;
         %>
        <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%= strClassType %>'"  class="<%= strClassType %>">
			<td class="<%= strClassType %>">
	        	&nbsp;<input type="checkbox" name="orgids" value="<%= orgMap.get("cityid") %>"  class="normalradio">
      		</td>
            <td class="<%= strClassType %>">&nbsp;<%= orgMap.get("citycode") %></td>
            <td class="<%= strClassType %>">&nbsp;<%= orgMap.get("cityname") %></td>
        </tr>
        </logic:iterate>

		<%@ include file="/inc/SummaryAction.inc" %>

		</table>
		<%//--------------------------------------  page operation button --%>
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
			<tr>
				
				<a onclick="javascript:add();"><custom:button type="1" label="L_Add" imgsrc="finish.gif" border="0" style="width:60" /></a></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</form>
</body>
</html>


